from lxml import etree
from StringIO import StringIO
from pylons import response


class Formatter(object):
    quality = 0
    def __call__(self, page, page_rev):
        raise "not implemented"


class RawFormatter(Formatter):
    quality = 100
    def __call__(self, page, page_rev):
        response.headers['Content-type'] = 'text/plain'
        return page_rev.body


class XMLFormatter(Formatter):
    def __call__(self, page, page_rev):
        response.headers['Content-type'] = 'text/xml'
        return page_rev.render()




